let app = new Vue({
    el: '#app',
    data() {
        return {
            form: {
                userName: '',
                userPassword: '',
            }
        };
    },
    methods: {
        resetForm(formName) {
            this.$refs[formName].resetFields();
        },
        login(){
            axios.post(
                '/login',
                'userId='+this.form.userName+
                '&userPassword='+this.form.userPassword
            ).then(function (response) {
                console.log(response);
                if (response.data === "SUCCESS")
                {
                    location.href= "/home"
                }
                else {
                    alert(response.data)
                }
            }).catch(function (error) {
                console.log(error);
            });
        }
    }

})